<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>
<%@ page isELIgnored="false" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
    Date date = new Date();
    String nowDate = sdf.format(date);
%>

<%--代表HTML5--%>
<!DOCTYPE html>
<html>
<%--Header Begin--%>
<head>
    <title>投诉反馈</title>
    <jsp:include page="../../../includes/header.jsp"/>
    <link href="//unpkg.com/layui@2.9.7/dist/css/layui.css" rel="stylesheet">
</head>

<body class="skin-blue layout-top-nav" style="height: auto; min-height: 100%;">

<div class="wrapper" style="height: auto; min-height: 100%;">

    <jsp:include page="../../../includes/top_navigation_reception.jsp"/>

    <!-- Full Width Column -->
    <div class="content-wrapper" style="min-height: 471px;">
        <div class="container">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <br>
                <h1>
                    投诉反馈
                </h1>
            </section>
            <br>
            <section class="content">
                <br>
                <%--danger alert--%>
                <c:if test="${msg.msg != null}">
                    <div class="alert alert-${msg.status == 200 ? "success" : "danger"} alert-dismissible">
                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×
                        </button>
                        <h4>${msg.msg}</h4>
                    </div>
                </c:if>
                <%--danger alert--%>

                <div class="box box-info">
                    <div class="box box-info">
                        <div class="box-header with-border">
                            <h3 class="box-title">投诉反馈</h3>
                            <br>
                        </div>
                        <!-- /.box-header -->
                        <!-- form start -->
                        <form class="form-horizontal" action="/feedback/save" method="post">
                            <div class="box-body">

                                <%--uid--%>
                                <div class="form-group">
                                    <label for="userId" class="col-sm-2 control-label">作者ID</label>
                                    <div class="col-sm-10">
                                        <input type="text" readonly name="userId" value="${user.uid}" class="form-control" id="userId" placeholder="${user.uid}">
                                    </div>
                                </div>

                                <%--uname--%>
                                <div class="form-group">
                                    <label for="tpAuthor" class="col-sm-2 control-label">作者名称</label>
                                    <div class="col-sm-10">
                                        <input type="text" readonly name="tpAuthor" value="${user.uname}"
                                               class="form-control"
                                               id="tpAuthor"
                                               placeholder="${user.uname}">
                                    </div>
                                </div>

                                <%--email--%>
                                <div class="form-group">
                                    <label for="title" class="col-sm-2 control-label">标题</label>

                                    <div class="col-sm-10">
                                        <input type="text" name="title" class="form-control"
                                               id="title"
                                        >
                                    </div>
                                </div>


                                <%--age--%>
                                <div class="form-group">
                                    <label for="score" class="col-sm-2 control-label">评分</label>

                                    <div class="col-sm-10">
                                        <div id="ID-rate-demo-setText-2" name="score1"></div>
                                        <input type="hidden" id="score" name="score" value="5"/>
                                    </div>
                                </div>


                                <%--Content Edit--%>
                                <div class="form-group">
                                    <label for="content" class="col-sm-2 control-label">内容</label>
                                    <div class="col-sm-10">
<%--                                        <input type="hidden" name="content" id="content"--%>
<%--                                               class="form-control"--%>
<%--                                               placeholder="编辑">--%>
                                        <textarea name="content" id="content" placeholder="请输入投诉内容" class="layui-textarea"></textarea>
<%--                                        &lt;%&ndash;wangEditor编辑&ndash;%&gt;--%>
<%--                                        <div id="editor">--%>

<%--                                        </div>--%>
                                    </div>
                                </div>

                            </div>
                            <!-- /.box-body -->

                            <div class="box-footer">
                                <button type="button" class="btn btn-default" onclick="history.go(-1);">
                                    返回
                                </button>
                                <button id="btnSunmit" type="submit" class="btn btn-info pull-right"
                                        onclick="">提交
                                </button>
                            </div>
                            <!-- /.box-footer -->
                        </form>
                    </div>
                    <!-- /.box-body -->
                </div>

                <hr>
            </section>
            <br>
            <!-- /.container -->
        </div>
        <!-- /.content-wrapper -->
    </div>

    <%--版权--%>
    <jsp:include page="../../../includes/copyright.jsp"/>
    <!-- ./wrapper -->
    <%--js--%>
    <jsp:include page="../../../includes/footer.jsp"/>
    <script src="//unpkg.com/layui@2.9.7/dist/layui.js"></script>
<%--    <script>--%>
<%--        $(function () {--%>
<%--            // wangEditor--%>
<%--            var E = window.wangEditor;--%>
<%--            var editor = new E('#editor');--%>

<%--            // 配置服务器端地址--%>
<%--            editor.customConfig.uploadImgServer = '/upload/fourmContentUpload';--%>

<%--            // 将图片大小限制为 3M 默认为5MB--%>
<%--            editor.customConfig.uploadImgMaxSize = 3 * 1024 * 1024;--%>
<%--            // 限制一次最多上传 20 张图片--%>
<%--            editor.customConfig.uploadImgMaxLength = 20;--%>
<%--            // 自定义 fileName--%>
<%--            editor.customConfig.uploadFileName = 'dropFile';--%>
<%--            editor.create();--%>
<%--            editor.customConfig.uploadImgHooks = {--%>
<%--                before: function (xhr, editor, files) {--%>

<%--                }--%>
<%--            };--%>

<%--            $("#btnSunmit").bind("click", function () {--%>
<%--                var contentHtml = editor.txt.html();--%>
<%--                console.log(contentHtml);//有内容的--%>
<%--                $("#content").val(contentHtml);--%>
<%--                // return false;--%>
<%--            });--%>
<%--        });--%>
<%--    </script>--%>
    <script>
        layui.use(function () {
            var rate = layui.rate;
            // 渲染
            rate.render({ // eg1
                elem: '#ID-rate-demo-setText-2',
                value: 5,
                text: true,
                setText: function (value) { // 自定义文本的初始回调
                    var arrs = {
                        '1': '非常不满意',
                        '2': '不满意',
                        '3': '一般',
                        '4': '满意',
                        '5': '非常满意',
                    };
                    this.span.text(arrs[value] || (value + "星"));
                },
                choose: function (value) {
                    $('#hiddenScore').val(value); // 获得选中的评分值
                }
            });
        })
    </script>

</body>
</html>